package remato.domain.server.ejb;

import static javax.persistence.CascadeType.ALL;
import static javax.persistence.GenerationType.AUTO;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;

import remato.domain.common.Status;
import remato.domain.common.impl.StatusImpl;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class StatusEjb extends StatusImpl {

	public StatusEjb() {
		super();
	}

	public StatusEjb(String name) {
		super(name);
	}

	public StatusEjb(String name, String description) {
		super(name, description);
	}

	@Override
	@Id
	@GeneratedValue(strategy=AUTO)
	public Long getDbId() {
		return super.getDbId();
	}

	@Override
	@Lob
	public String getDescription() {
		return super.getDescription();
	}

	@Override
	public String getName() {
		return super.getName();
	}

	@Override
    @ManyToMany( targetEntity = StatusEjb.class, cascade ={ALL}, fetch=FetchType.EAGER )
	public Set<Status> getNextStatuses() {
		return super.getNextStatuses();
	}

}
